package com.mes.cloud.base.multipart;

import com.mes.cloud.base.cache.annotation.Cache;
import com.mes.cloud.base.cache.annotation.CacheRefresh;
import org.springframework.core.io.InputStreamResource;

import java.io.IOException;
import java.io.InputStream;

/**
 * Created by Lenovo on 2017/8/29.
 */
public class MultipartFileResource extends InputStreamResource {
    private String filename;

    public MultipartFileResource(InputStream inputStream, String filename) {
        super(inputStream);
        this.filename = filename;
    }

    @Override
    public String getFilename() {
        return this.filename;
    }

    @Override
    public long contentLength() throws IOException {
        return -1; // we do not want to generally read the whole stream into memory ...
    }
}